/*  
	File-Name:      KVP_jop_rep.do
	Date:			03/21/2015
	Authors:		M.Kenwick, J.Vasquez, M.Powers
	Purpose:		Replication of results from main text and appendix
	Input Files:	jl_10yrd_1816-2000.dta; jl_10yrd_1816-1945.dta;
					jl_10yrd_1946-2000.dta; ben_10yrd_1816-2000.dta
					ben_10yrd_1816-1945.dta; ben_10yrd_1946-2000.dta

*/

/*Note: conducting the matching analysis requires the cem package. This can be
done using the command lines below.*/

*net from http://gking.harvard.edu/cem/
*net install cem

cd "/Users/kenwick2/Desktop/Long_final/KVP_jop_rep"
set more off

* **************************************************************************** *
* Table A1
* **************************************************************************** *

*Table A1.1
use jl_10yrd_1816-2000.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 583 305 .5
bitesti 132 78 .5
*table A1.2
use jl_10yrd_1816-1945.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 368 186 .5
bitesti 74 47 .5
*Table A1.3
use jl_10yrd_1946-2000.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 210 118 .5
bitesti 43 24 .5


* **************************************************************************** *
* Table A2
* **************************************************************************** *
*Table A2.1
use ben_10yrd_1816-2000.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 595 303 .5
bitesti 69 47 .5
*Table A2.2
use ben_10yrd_1816-1945.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 357 177 .5
bitesti 35 25 .5
*Table A2.3
use ben_10yrd_1946-2000.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 25 15 .5
bitesti 235 126 .5


* **************************************************************************** *
* Table A3
* **************************************************************************** *
*Table A3.1
use jl_10yrd_1816-2000.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 156 73 .5
bitesti 71 48 .5
*Table A3.2
use jl_10yrd_1816-1945.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 100 54 .5
bitesti 45 31 .5
*Table A3.3
use jl_10yrd_1946-2000.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 55 19 .5
bitesti 24 17 .5


* **************************************************************************** *
* Table A4
* **************************************************************************** *
*Table A4.1
use ben_10yrd_1816-2000.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 195 84 .5
bitesti 42 24 .5
*Table A4.2
use ben_10yrd_1816-1945.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 136 71 .5
bitesti 37 20 .5
*Table A4.3
use ben_10yrd_1946-2000.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 58 12 .5
bitesti 2 2 .5


* **************************************************************************** *
* Figure 1a (Table A5 in online appendix)
* **************************************************************************** *

****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]


* **************************************************************************** *
* Figure 1b (Table A6 in online appendix)
* **************************************************************************** *

****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft longitudinal_treatment [iweight=cem_weights]


* **************************************************************************** *
* Figure 1c (Table A7 in online appendix)
* **************************************************************************** *

****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]


****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]


*Ben
use ben_10yrd_1946-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]


* **************************************************************************** *
* Figure 1d (Table A8 in online appendix)
* **************************************************************************** *
****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]


****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000_pure.dta, clear

cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anywarafter longitudinal_treatment [iweight=cem_weights]

* **************************************************************************** *
* Table A9 - Use of Force MIDs as DV
* **************************************************************************** *

****
* 1816-2000            
****
*JL
use jl_10yrd_1816-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]


* **************************************************************************** *
* Table A10 - Use of Force MIDs as DV, "Pure" Defensive Alliances
* **************************************************************************** *

****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000_pure.dta, clear
gen id = ""
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_use longitudinal_treatment [iweight=cem_weights]


* **************************************************************************** *
* Table A11 - MID Initiation, with joiners as DV
* **************************************************************************** *

****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]


****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]


* **************************************************************************** *
* Table A12 - MID Initiation, with joiners as DV, Only "Pure" Defensive Alliances
* **************************************************************************** *
set more off
****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin longitudinal_treatment [iweight=cem_weights]



* **************************************************************************** *
* Table A13 - Use of Force MID Initiation, Joiners included
* **************************************************************************** *

****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-1945.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]


* **************************************************************************** *
* Table A14 - Use of Force MID Initiation, Joiners included, Only "Pure" 
* 			 Defensive Alliances
* **************************************************************************** *

****
* 1816-2000            
****

*JL
use jl_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1816-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

****
* 1816-1945            
****

*JL
use jl_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]
	
*Ben
use ben_10yrd_1816-1945_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

****
* 1946-2000            
****

*JL
use jl_10yrd_1946-2000_pure.dta, clear
cem jdem(#0) pchaloff(#0) pchalneu(#0) contig(#0) ccode1_maj(#0) ///
	ccode2_maj(#0) rivalry_bef(#0) disputes_before_use (#0) ptargoff(#0) ///
	ptargneu(#0), tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]

*Ben
use ben_10yrd_1946-2000_pure.dta, clear
cem jdem(#0) contig(#0) ccode1_maj(#0) ccode2_maj(#0) rivalry_bef(#0) ///
	disputes_before_use(#0) uncondeter(#0) probabilistic(#0) condcompel(#0) ///
	uncondcompel(#0) targ_condcompel(#0) targ_uncondcompel(#0) ///
	, tr(longitudinal_treatment)
logit anydispaft_wjoin_use longitudinal_treatment [iweight=cem_weights]


* **************************************************************************** *
* Table A15
* **************************************************************************** *
*Table A15.1
use jl_10yrd_1816-2000_pure.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 658 336 .5
bitesti 118 56 .5
*Table A15.2
use jl_10yrd_1816-1945_pure.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 384 193 .5
bitesti 43 19 .5
*Table A15.3
use jl_10yrd_1946-2000_pure.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 256 134 .5
bitesti 60 30 .5


* **************************************************************************** *
* Table A16
* **************************************************************************** *
*Table A16.1 
use ben_10yrd_1816-2000_pure.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 645 328 .5
bitesti 82 54 .5
*Table A16.2 
use ben_10yrd_1816-1945_pure.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 370 177 .5
bitesti 36 25 .5
*Table A16.3 
use ben_10yrd_1946-2000_pure.dta, clear
tab longitudinal_treatment disputeindex, row chi
bitesti 272 139 .5
bitesti 37 22 .5


* **************************************************************************** *
* Table A17
* **************************************************************************** *
*Table A17.1
use jl_10yrd_1816-2000_pure.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 188 95 .5
bitesti 46 30 .5
*Table A17.2
use jl_10yrd_1816-1945_pure.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 122 76 .5
bitesti 19 13 .5
*Table A17.3
use jl_10yrd_1946-2000_pure.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 58 19 .5
bitesti 25 17 .5


* **************************************************************************** *
* Table A18
* **************************************************************************** *
*Table A18.1
use ben_10yrd_1816-2000_pure.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 211 92 .5
bitesti 42 25 .5
*Table A18.2
use ben_10yrd_1816-1945_pure.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 148 78 .5
bitesti 36 21 .5
*Table A18.3
use ben_10yrd_1946-2000_pure.dta, clear
tab longitudinal_treatment warindex, row chi
bitesti 62 13 .5
bitesti 3 2 .5
